package com.lagou.service;

import com.lagou.dao.UserDao;

import com.lagou.dao.UserDaoImplement;

import com.lagou.entity.User;


import java.sql.SQLException;


public class UserServiceImplement implements UserService {



    /*

        根据用户密码查询用户信息

     */

    @Override

    public User login(String name, String password) throws SQLException {


        UserDao userDao = new UserDaoImplement();

        User user = userDao.login(name, password);

        return user;

    }


    @Override

    public void addUser(User user) throws SQLException {

        UserDao userDao = new UserDaoImplement();

        userDao.addUser(user);

    }

}